<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>天气案例</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="app">
        <h3>今天天气很{{info}}</h3>
        <button @click="changeWeather">切换天气</button>
    </div>
    <script>
    //配置完全局配置之后再创建Vue实例,关闭Vue的生产提示标识
     Vue.config.productionTip = false;
        const vm = new Vue({
            el: '#app',
            data: {
                isHot: true
            },
            methods: {
                changeWeather(){
                    this.isHot=!this.isHot;
                }
            },
            computed: {
                info(){
                    return this.isHot? "炎热" : "凉爽";
                }
            }
        });
    </script>
</body>

</html>